const express = require('express')
const data = require('./express06data')
const router = express.Router()

router.get('/goods', (req, res) => {
	console.log('中间件',req.query)
	res.send(data.goods)
})
router.get('/goods/:id', (req, res) => {
	console.log(req.params.id)
	res.send(data.goodsid)
})
router.put('/goods/:id', (req, res) => {
	console.log('我是put方法',req.params.id)
	res.send(data.putgoodid)
})
router.delete('/goods/:id', (req, res) => {
	console.log('我是del方法',req.params.id)
	res.send(data.delgoodid)
})
// 把这个router抛出去
module.exports = router